package com.xqyq.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="report_content")
public class ReportContent {
	private int content_id;
	//对应哪个报道
	private Report report;
	//报道内容
	private String content;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getContent_id() {
		return content_id;
	}
	public void setContent_id(int content_id) {
		this.content_id = content_id;
	}
	@JoinColumn(name="report_id")
	@OneToOne(cascade={CascadeType.REFRESH},fetch=FetchType.LAZY)
	public Report getReport() {
		return report;
	}
	public void setReport(Report report) {
		this.report = report;
	}
	@Lob
	@Column(columnDefinition="text")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@Override
	public String toString() {
		return "ReportContent [content_id=" + content_id + ",content=" + content + "]";
	}

}
